<% form_tag({:controller => "images", :action => 'create'}, :multipart=>true ) do %>
  <% if @image.errors.any? %>
    <div id="error_explanation">
      <h2><%= pluralize(@image.errors.count, "error") %> prohibited this image from being saved:</h2>

      <ul>
      <% @image.errors.full_messages.each do |msg| %>
        <li><%= msg %></li>
      <% end %>
      </ul>
    </div>
  <% end %>
  
  <div class="field">
	Title<br>
	<input type="text" name="image[title]" value="<%= @image.title %>">
  </div><br>
	Event<br><br>
  <select name="image[event_id]" >
		<% @event.each do |event| %>
			<option value= <%= event.id %> > <%= event.title %></option><br />		
		<% end %>
  </select><br><br>
  <label for="upload_file">Select image</label><br><br>
  <input type="file" name="image[picture]" size="40" /><br><br>
  Select thumbnail:<br><br>
  <% @thumbnail.each do |thumbnail| %>
			<input type="checkbox" name="ids[<%= thumbnail.id.to_s %>]"><%= thumbnail.name %><br />		
	<% end %>  
   <br>
  
    
  <div class="actions">
  <br>
   <%= submit_tag( "Create Image" ) %>
  </div>
<% end %>
